//
//  ImageModel.m
//  糗事百科
//
//  Created by 奚超明 on 16/6/1.
//  Copyright © 2016年 奚超明. All rights reserved.
//

#import "ImageModel.h"

@implementation ImageModel

+ (instancetype)imageWithDic:(NSDictionary *)dic
{
    ImageModel *model = [[ImageModel alloc] init];
    CGFloat width = [dic[@"s"][1] doubleValue];
    CGFloat height = [dic[@"m"][1] doubleValue];
    model.width = [UIScreen mainScreen].bounds.size.width - 2 * kMargin;
    model.height = height * model.width / width;
    return model;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

@end
